package cn.kin.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.kin.dao.DataDictionaryMapper;
import cn.kin.pojo.DataDictionary;
import cn.kin.service.DataDictionaryService;
//字典
@Service
public class DataDictionaryServiceImpl implements DataDictionaryService{

	@Resource
	private DataDictionaryMapper mapper;
	
	@Override
	public List<DataDictionary> getAllPosition() {
		// TODO Auto-generated method stub
		List<DataDictionary> list=null;
		try {
			list=mapper.selectByTypeCode("POSITION");
		}catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			list=null;
		}
		return list;
	}
	
	@Override
	public List<DataDictionary> getAllSituation() {
		// TODO Auto-generated method stub
		List<DataDictionary> list=null;
		try {
			list=mapper.selectByTypeCode("SITUATION");
		}catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			list=null;
		}
		return list;
	}
	
	@Override
	public List<DataDictionary> getAllArticle() {
		// TODO Auto-generated method stub
		List<DataDictionary> list=null;
		try {
			list=mapper.selectByTypeCode("ARTICLE");
		}catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			list=null;
		}
		return list;
	}
	
	@Override
	public List<DataDictionary> getAllLeaveApply() {
		// TODO Auto-generated method stub
		List<DataDictionary> list=null;
		try {
			list=mapper.selectByTypeCode("LEAVEAPPLY");
		}catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			list=null;
		}
		return list;
	}
	
	@Override
	public List<DataDictionary> getAllState() {
		// TODO Auto-generated method stub
		List<DataDictionary> list=null;
		try {
			list=mapper.selectByTypeCode("STATE");
		}catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			list=null;
		}
		return list;
	}
}
